<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>028-Promise的finally方法.html</title>
</head>
<body>
	
</body>
<script type="text/javascript">
	const getImagePromise = (src)=> new promise((resolve,reject)=>{
		const img = new Image()
		img.onload = function(){
			resolve(src + 'img loaded success!')
		}
		img.onerror = function(){
			reject(src + 'img loaded error!')
		}
		img.src = src
	})
	getImagePromise('./')
	.then(data=>{
		console.log(data)
	})
	.catch(err=>{
		console.log(err)
	})
</script>
</html>